home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Development / RAVE SDK 1.0.6 GM for MacOS / Headers / RAVE.h < prev   
Encoding:
C/C++ Source or Header  |  1996-04-30  |  38.4 KB  |  1,020 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        RAVE.h                                                     **
  4.  **                                                                          **
  5.  **     Purpose:     Header file for RAVE API                                 **
  6.  **                                                                          **
  7.  **     Author:        Mike W. Kelley                                             **
  8.  **                                                                          **
  9.  **     Copyright (C) 1994-96 Apple Computer, Inc.  All rights reserved.     **
  10.  **        OpenGL™ is a trademark of Silicon Graphics, Inc.                     **
  11.  **                                                                          **
  12.  *****************************************************************************/
  13.  
  14. #ifndef _RAVE_h
  15. #define _RAVE_h
  16.  
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20.  
  21. /******************************************************************************
  22.  *
  23.  * Platform macros.
  24.  * This sets kQAPlatform to one of kQAMacOS, kQAWin32, or kQAGeneric.
  25.  * kQAPlatform controls platform-specific compilation switches and types.
  26.  *
  27.  *****************************************************************************/
  28.  
  29. #if !defined(kQAMacOS)
  30. #define    kQAMacOS        1            /* Target is MacOS                    */
  31. #endif
  32.  
  33. #if !defined(kQAGeneric)
  34. #define kQAGeneric        2            /* Target is generic platform        */
  35. #endif
  36.  
  37. #if !defined(kQAWin32)
  38. #define kQAWin32        3            /* Target is Win32                    */
  39. #endif
  40.  
  41. #if defined(_WIN32) || defined(_WINDOWS)
  42.     #define kQAPlatform kQAWin32
  43. #elif !defined(kQAPlatform)
  44.     #define kQAPlatform kQAMacOS
  45. #endif
  46.  
  47. /******************************************************************************
  48.  *
  49.  * Export Control
  50.  *
  51.  *****************************************************************************/
  52.  
  53. #if defined(_MSC_VER)    /* Microsoft Visual C */
  54.     #define    RAVE_EXPORT        __declspec( dllexport )
  55. #else
  56.     #define RAVE_EXPORT
  57. #endif /* _MSC_VER */
  58.  
  59. /******************************************************************************
  60.  *
  61.  * Platform dependent datatypes: TQAImagePixelType, TQADevice, TQAClip, and TQARect.
  62.  *
  63.  *****************************************************************************/
  64.  
  65. typedef enum TQAImagePixelType
  66. {
  67.     kQAPixel_Alpha1        = 0,        /* 1 bit/pixel alpha */
  68.     kQAPixel_RGB16        = 1,        /* 16 bit/pixel, R=14:10, G=9:5, B=4:0 */
  69.     kQAPixel_ARGB16        = 2,        /* 16 bit/pixel, A=15, R=14:10, G=9:5, B=4:0 */
  70.     kQAPixel_RGB32        = 3,        /* 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  71.     kQAPixel_ARGB32        = 4,        /* 32 bit/pixel, A=31:24, R=23:16, G=15:8, B=7:0 */
  72.     kQAPixel_CL4        = 5,        /* 4 bit color look up table, always big endian,
  73.                                         ie high 4 bits effect left pixel */
  74.     kQAPixel_CL8        = 6            /* 8 bit color look up table */
  75. } TQAImagePixelType;
  76.  
  77. typedef enum TQAColorTableType
  78. {
  79.     kQAColorTable_CL8_RGB32        = 0,        /* 256 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  80.     kQAColorTable_CL4_RGB32        = 1            /* 16 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  81. } TQAColorTableType;
  82.  
  83. typedef enum TQADeviceType            /* Selects target device type */
  84. {
  85.     kQADeviceMemory        = 0,        /* Memory draw context */
  86.     kQADeviceGDevice    = 1,        /* Macintosh GDevice draw context */
  87.     kQADeviceWin32DC    = 2,        /* Win32 DC  */
  88.     kQADeviceDDSurface    = 3            /* Win32 DirectDraw Surface */
  89. } TQADeviceType;
  90.  
  91. typedef struct TQADeviceMemory        /* Generic memory pixmap device */
  92. {
  93.     long                rowBytes;    /* Rowbytes */
  94.     TQAImagePixelType    pixelType;    /* Depth, color space, etc. */
  95.     long                width;        /* Width in pixels */
  96.     long                height;        /* Height in pixels */
  97.     void                *baseAddr;    /* Base address of pixmap */
  98. } TQADeviceMemory;
  99.  
  100. typedef enum TQAClipType            /* Selects target clip type */
  101. {
  102.     kQAClipRgn            = 0,        /* Macintosh clipRgn with serial number */
  103.     kQAClipWin32Rgn        = 1            /* Win32 clip region */
  104. } TQAClipType;
  105.  
  106. typedef struct TQARect
  107. {
  108.     long                left;
  109.     long                right;
  110.     long                top;
  111.     long                bottom;
  112. } TQARect;
  113.  
  114. #if (kQAPlatform == kQAMacOS)
  115.     /*
  116.      * MacOS supports memory and GDevice. TQARect == Rect. TQAClip is a clipRgn.
  117.      */
  118.     
  119.     #include <Quickdraw.h>
  120.     #include <QDOffscreen.h>
  121.     
  122.     typedef union TQAPlatformDevice
  123.     {
  124.         TQADeviceMemory    memoryDevice;
  125.         GDHandle        gDevice;
  126.     } TQAPlatformDevice;
  127.     
  128.     typedef union TQAPlatformClip
  129.     {
  130.         RgnHandle        clipRgn;
  131.     } TQAPlatformClip;
  132.     
  133. #elif (kQAPlatform == kQAWin32)
  134.     /*
  135.      * Win32 platform. TQARect is generic. TQAPlatform is DC or Surface. TQAClip is HRGN.
  136.      */
  137.     #include <windows.h>
  138.     #include <ddraw.h>
  139.  
  140.     typedef union TQAPlatformDevice
  141.     {
  142.         TQADeviceMemory            memoryDevice;
  143.         HDC                        hdc;
  144.         struct
  145.         {
  146.             LPDIRECTDRAW            lpDirectDraw;
  147.             LPDIRECTDRAWSURFACE        lpDirectDrawSurface;
  148.         };
  149.     } TQAPlatformDevice;
  150.  
  151.     typedef union TQAPlatformClip
  152.     {
  153.         HRGN            clipRgn;
  154.     } TQAPlatformClip;
  155. #elif (kQAPlatform == kQAGeneric)
  156.     /*
  157.      * Generic platform supports memory device only. TQARect is generic. TQAClip is ???.
  158.      */
  159.     
  160.     typedef union TQAPlatformDevice
  161.     {
  162.         TQADeviceMemory    memoryDevice;
  163.     } TQAPlatformDevice;
  164.     
  165.     typedef union TQAPlatformClip
  166.     {
  167.         void            *region;            /* ??? */
  168.     } TQAPlatformClip;
  169. #else
  170.     ??? Unrecognized kQAPlatform
  171. #endif
  172.  
  173. typedef struct TQADevice
  174. {
  175.     TQADeviceType        deviceType;
  176.     TQAPlatformDevice    device;
  177. } TQADevice;
  178.  
  179. typedef struct TQAClip
  180. {
  181.     TQAClipType            clipType;
  182.     TQAPlatformClip        clip;
  183. } TQAClip;
  184.  
  185. /******************************************************************************
  186.  *
  187.  * Basic data types.
  188.  *
  189.  *****************************************************************************/
  190.  
  191. typedef struct    TQADrawContext TQADrawContext;    /* Drawing context for an engine */
  192. typedef struct    TQAEngine TQAEngine;            /* Pointer to a drawing engine */
  193. typedef struct    TQATexture TQATexture;            /* Pointer to an allocated texture map */
  194. typedef struct    TQABitmap TQABitmap;            /* Pointer to an allocated bitmap */
  195. typedef struct    TQADrawPrivate TQADrawPrivate;    /* Engine's private draw context pointer */
  196. typedef struct    TQAImage TQAImage;                /* An image for use as texture or bitmap */
  197. typedef struct    TQAColorTable TQAColorTable;
  198.  
  199. typedef struct TQAIndexedTriangle                /* A single triangle element for QADrawTriMesh */
  200. {
  201.     unsigned long    triangleFlags;                /* Triangle flags, see kQATriFlags_ */
  202.     unsigned long    vertices[3];                /* Indices into a vertex array */
  203. } TQAIndexedTriangle;
  204.  
  205. struct TQAImage                                    /* An image for use as texture or bitmap */
  206. {
  207.     long        width;                            /* Width of pixmap */
  208.     long        height;                            /* Height of pixmap */
  209.     long        rowBytes;                        /* Rowbytes of pixmap */
  210.     void        *pixmap;                        /* Pixmap */
  211. };
  212.  
  213. typedef enum TQAError                            /* Standard error type */
  214. {
  215.     kQANoErr                = 0,                /* No error */
  216.     kQAError                = 1,                /* Generic error flag */
  217.     kQAOutOfMemory            = 2,                /* Insufficient memory */
  218.     kQANotSupported            = 3,                /* Requested feature is not supported */
  219.     kQAOutOfDate            = 4,                /* A newer drawing engine was registered */
  220.     kQAParamErr                = 5,                /* Error in passed parameters */
  221.     kQAGestaltUnknown        = 6                    /* Requested gestalt type isn't available */
  222. } TQAError;
  223.  
  224. /************************************************************************************************
  225.  *
  226.  * Vertex data types.
  227.  *
  228.  ***********************************************************************************************/
  229.  
  230. /*
  231.  * TQAVGouraud is used for Gouraud shading. Each vertex specifies position, color and Z.
  232.  *
  233.  * Alpha is always treated as indicating transparency. Drawing engines which don't
  234.  * support Z-sorted rendering use the back-to-front transparency blending functions
  235.  * shown below. (ARGBsrc are the source (new) values, ARGBdest are  the destination
  236.  * (previous) pixel values.)
  237.  *
  238.  *        Premultiplied                            Interpolated
  239.  *
  240.  *        A = 1 - (1 - Asrc) * (1 - Adest)        A = 1 - (1 - Asrc) * (1 - Adest) 
  241.  *        R = (1 - Asrc) * Rdest + Rsrc            R = (1 - Asrc) * Rdest + Asrc * Rsrc
  242.  *        G = (1 - Asrc) * Gdest + Gsrc            G = (1 - Asrc) * Gdest + Asrc * Gsrc
  243.  *        B = (1 - Asrc) * Bdest + Bsrc            B = (1 - Asrc) * Bdest + Asrc * Bsrc
  244.  *
  245.  * Note that the use of other blending modes to implement antialiasing is performed
  246.  * automatically by the drawing engine when the kQATag_Antialias variable !=
  247.  * kQAAntiAlias_Fast. The driving software should continue to use the alpha fields
  248.  * for transparency even when antialiasing is being used (the drawing engine will
  249.  * resolve the multiple blending requirements as best as it can).
  250.  *
  251.  * Drawing engines which perform front-to-back Z-sorted rendering should replace
  252.  * the blending function shown above with the equivalent front-to-back formula.
  253.  */
  254.  
  255. typedef struct TQAVGouraud
  256. {
  257.     float                x;        /* X pixel coordinate, 0.0 <= x < width */
  258.     float                y;        /* Y pixel coordinate, 0.0 <= y < height */
  259.     float                z;        /* Z coordinate, 0.0 <= z <= 1.0 */
  260.     float                invW;    /* 1 / w; required only when kQAPerspectiveZ_On is set */
  261.     
  262.     float                r;        /* Red, 0.0 <= r <= 1.0 */
  263.     float                g;        /* Green, 0.0 <= g <= 1.0 */
  264.     float                b;        /* Blue, 0.0 <= b <= 1.0 */
  265.     float                a;        /* Alpha, 0.0 <= a <= 1.0, 1.0 is opaque */
  266. } TQAVGouraud;
  267.  
  268. /*
  269.  * TQAVTexture is used for texture mapping. The texture mapping operation
  270.  * is controlled by the kQATag_TextureOp variable, which is a mask of
  271.  * kQATextureOp_None/Modulate/Highlight/Decal. Below is pseudo-code for the
  272.  * texture shading operation:
  273.  *
  274.  *        texPix = TextureLookup (uq/q, vq/q);
  275.  *        if (kQATextureOp_Decal)
  276.  *        {
  277.  *            texPix.r = texPix.a * texPix.r + (1 - texPix.a) * r;
  278.  *            texPix.g = texPix.a * texPix.g + (1 - texPix.a) * g;
  279.  *            texPix.b = texPix.a * texPix.b + (1 - texPix.a) * b;
  280.  *            texPix.a = a;
  281.  *        }
  282.  *        else
  283.  *        {
  284.  *            texPix.a = texPix.a * a;
  285.  *        }
  286.  *        if (kQATextureOp_Modulate)
  287.  *        {
  288.  *            texPix.r *= kd_r;        // Clamped to prevent overflow
  289.  *            texPix.g *= kd_g;        // Clamped to prevent overflow
  290.  *            texPix.b *= kd_b;        // Clamped to prevent overflow
  291.  *        }
  292.  *        if (kQATextureOp_Highlight)
  293.  *        {
  294.  *            texPix.r += ks_r;        // Clamped to prevent overflow
  295.  *            texPix.g += ks_g;        // Clamped to prevent overflow
  296.  *            texPix.b += ks_b;        // Clamped to prevent overflow
  297.  *        }
  298.  *
  299.  * After computation of texPix, transparency blending (as shown
  300.  * above for TQAVGouraud) is performed.
  301.  */
  302.  
  303. typedef struct TQAVTexture
  304. {
  305.     float                x;        /* X pixel coordinate, 0.0 <= x < width */
  306.     float                y;        /* Y pixel coordinate, 0.0 <= y < height */
  307.     float                z;        /* Z coordinate, 0.0 <= z <= 1.0 */
  308.     float                invW;    /* 1 / w (always required) */
  309.     
  310.     /* rgb are used only when kQATextureOp_Decal is set. a is always required */
  311.     
  312.     float                r;        /* Red, 0.0 <= r <= 1.0 */
  313.     float                g;        /* Green, 0.0 <= g <= 1.0 */
  314.     float                b;        /* Blue, 0.0 <= b <= 1.0 */
  315.     float                a;        /* Alpha, 0.0 <= a <= 1.0, 1.0 is opaque */
  316.  
  317.     /* uOverW and vOverW are required by all modes */
  318.     
  319.     float                uOverW;    /* u / w */
  320.     float                vOverW;    /* v / w */
  321.     
  322.     /* kd_r/g/b are used only when kQATextureOp_Modulate is set */
  323.     
  324.     float                kd_r;    /* Scale factor for texture red, 0.0 <= kd_r */
  325.     float                kd_g;    /* Scale factor for texture green, 0.0 <= kd_g */
  326.     float                kd_b;    /* Scale factor for texture blue, 0.0 <= kd_b */
  327.     
  328.     /* ks_r/g/b are used only when kQATextureOp_Highlight is set */
  329.     
  330.     float                ks_r;    /* Red specular highlight, 0.0 <= ks_r <= 1.0 */
  331.     float                ks_g;    /* Green specular highlight, 0.0 <= ks_g <= 1.0 */
  332.     float                ks_b;    /* Blue specular highlight, 0.0 <= ks_b <= 1.0 */
  333. } TQAVTexture;
  334.  
  335. /************************************************************************************************
  336.  *
  337.  * Constants used for the state variables.
  338.  *
  339.  ***********************************************************************************************/
  340.  
  341. /*
  342.  * kQATag_xxx is used to select a state variable when calling QASetFloat(), QASetInt(),
  343.  * QAGetFloat() and QAGetInt(). The kQATag values are split into two separate
  344.  * enumerated types: TQATagInt and TQATagFloat. TQATagInt is used for the QASet/GetInt()
  345.  * functions, and TQATagFloat is used for the QASet/GetFloat() functions. (This is so
  346.  * that a compiler that typechecks enums can flag a float/int tag mismatch during compile.)
  347.  *
  348.  * These variables are required by all drawing engines:
  349.  *        kQATag_ZFunction            (Int)    One of kQAZFunction_xxx
  350.  *        kQATag_ColorBG_a            (Float)    Background color alpha
  351.  *        kQATag_ColorBG_r            (Float)    Background color red
  352.  *        kQATag_ColorBG_g            (Float)    Background color green
  353.  *        kQATag_ColorBG_b            (Float)    Background color blue
  354.  *        kQATag_Width                (Float)    Line and point width (pixels)
  355.  *        kQATag_ZMinOffset            (Float)    Min offset to Z to guarantee visibility (Read only!)
  356.  *        kQATag_ZMinScale            (Float)    Min scale to Z to guarantee visibility (Read only!)
  357.  
  358.  * These variables are used for optional features:
  359.  *        kQATag_Antialias            (Int)    One of kQAAntiAlias_xxx
  360.  *        kQATag_Blend                (Int)    One of kQABlend_xxx
  361.  *        kQATag_PerspectiveZ            (Int)    One of kQAPerspectiveZ_xxx
  362.  *        kQATag_TextureFilter        (Int)    One of kQATextureFilter_xxx
  363.  *        kQATag_TextureOp            (Int)    Mask of kQATextureOp_xxx
  364.  *        kQATag_Texture                (Int)    Pointer to current TQATexture
  365.  *        kQATag_CSGTag                (Int)    One of kQACSGTag_xxx
  366.  *        kQATag_CSGEquation            (Int)    32 bit CSG truth table
  367.  *
  368.  * These variables are used for OpenGL™ support:
  369.  *        kQATagGL_DrawBuffer            (Int)    Mask of kQAGL_DrawBuffer_xxx
  370.  *        kQATagGL_TextureWrapU        (Int)    kQAGL_Clamp or kQAGL_Repeat
  371.  *        kQATagGL_TextureWrapV        (Int)    kQAGL_Clamp or kQAGL_Repeat
  372.  *        kQATagGL_TextureMagFilter    (Int)    kQAGL_Nearest or kQAGL_Linear
  373.  *        kQATagGL_TextureMinFilter    (Int)    kQAGL_Nearest, etc.
  374.  *        kQATagGL_ScissorXMin        (Int)    Minimum X value for scissor rectangle
  375.  *        kQATagGL_ScissorYMin        (Int)    Minimum Y value for scissor rectangle
  376.  *        kQATagGL_ScissorXMax        (Int)    Maximum X value for scissor rectangle
  377.  *        kQATagGL_ScissorYMax        (Int)    Maximum Y value for scissor rectangle
  378.  *        kQATagGL_BlendSrc            (Int)    Source blending operation
  379.  *        kQATagGL_BlendDst            (Int)    Destination blending operation
  380.  *        kQATagGL_LinePattern        (Int)    Line rasterization pattern
  381.  *        kQATagGL_AreaPattern0        (Int)    First of 32 area pattern registers
  382.  *        kQATagGL_AreaPattern31        (Int)    Last of 32 area pattern registers
  383.  *        kQATagGL_DepthBG            (Float)    Background Z
  384.  *        kQATagGL_TextureBorder_a    (Float)    Texture border color alpha
  385.  *        kQATagGL_TextureBorder_r    (Float)    Texture border color red
  386.  *        kQATagGL_TextureBorder_g    (Float)    Texture border color green
  387.  *        kQATagGL_TextureBorder_b    (Float)    Texture border color blue
  388.  *
  389.  * Tags >= kQATag_EngineSpecific_Minimum may be assigned by the vendor for use as
  390.  * engine-specific variables. NOTE: These should be used only in exceptional circumstances,
  391.  * as functions performed by these variables won't be generally accessible. All other tag
  392.  * values are reserved.
  393.  *
  394.  *        kQATag_EngineSpecific_Minimum    Minimum tag value for drawing-engine specific variables
  395.  */
  396.  
  397. typedef enum TQATagInt
  398. {
  399.     kQATag_ZFunction                = 0,
  400.     kQATag_Antialias                = 8,
  401.     kQATag_Blend                    = 9,
  402.     kQATag_PerspectiveZ                = 10,
  403.     kQATag_TextureFilter            = 11,
  404.     kQATag_TextureOp                = 12,
  405.     kQATag_CSGTag                    = 14,
  406.     kQATag_CSGEquation                = 15,
  407.     kQATagGL_DrawBuffer                = 100,
  408.     kQATagGL_TextureWrapU            = 101,
  409.     kQATagGL_TextureWrapV            = 102,
  410.     kQATagGL_TextureMagFilter        = 103,
  411.     kQATagGL_TextureMinFilter        = 104,
  412.     kQATagGL_ScissorXMin            = 105,
  413.     kQATagGL_ScissorYMin            = 106,
  414.     kQATagGL_ScissorXMax            = 107,
  415.     kQATagGL_ScissorYMax            = 108,
  416.     kQATagGL_BlendSrc                = 109,
  417.     kQATagGL_BlendDst                = 110,
  418.     kQATagGL_LinePattern            = 111,
  419.     kQATagGL_AreaPattern0            = 117,
  420.         /* ...1-30 */
  421.     kQATagGL_AreaPattern31            = 148,
  422.     kQATag_EngineSpecific_Minimum    = 1000
  423. } TQATagInt;
  424.  
  425. typedef enum TQATagPtr
  426. {
  427.     kQATag_Texture                    = 13
  428. } TQATagPtr;
  429.  
  430. typedef enum TQATagFloat
  431. {
  432.     kQATag_ColorBG_a                = 1,
  433.     kQATag_ColorBG_r                = 2,
  434.     kQATag_ColorBG_g                = 3,
  435.     kQATag_ColorBG_b                = 4,
  436.     kQATag_Width                    = 5,
  437.     kQATag_ZMinOffset                = 6,
  438.     kQATag_ZMinScale                = 7,
  439.     kQATagGL_DepthBG                = 112,
  440.     kQATagGL_TextureBorder_a        = 113,
  441.     kQATagGL_TextureBorder_r        = 114,
  442.     kQATagGL_TextureBorder_g        = 115,
  443.     kQATagGL_TextureBorder_b        = 116
  444. } TQATagFloat;
  445.  
  446. /* kQATag_ZFunction */
  447. #define kQAZFunction_None            0    /* Z is neither tested nor written (same as no Z buffer) */
  448. #define kQAZFunction_LT                1    /* Znew < Zbuffer is visible */
  449. #define kQAZFunction_EQ                2    /* Znew == Zbuffer is visible */
  450. #define kQAZFunction_LE                3    /* Znew <= Zbuffer is visible */
  451. #define kQAZFunction_GT                4    /* Znew > Zbuffer is visible */
  452. #define kQAZFunction_NE                5    /* Znew != Zbuffer is visible */
  453. #define kQAZFunction_GE                6    /* Znew >= Zbuffer is visible */
  454. #define kQAZFunction_True            7    /* Znew is always visible */
  455.  
  456. /* kQATag_Width */
  457. #define kQAMaxWidth                    128.0
  458.  
  459. /* kQATag_Antialias */
  460. #define kQAAntiAlias_Off            0
  461. #define kQAAntiAlias_Fast            1
  462. #define kQAAntiAlias_Mid            2
  463. #define kQAAntiAlias_Best            3
  464.  
  465. /* kQATag_Blend */
  466. #define kQABlend_PreMultiply        0
  467. #define kQABlend_Interpolate        1
  468. #define kQABlend_OpenGL                2
  469.  
  470. /* kQATag_PerspectiveZ */
  471. #define kQAPerspectiveZ_Off            0    /* Use Z for hidden surface removal */
  472. #define kQAPerspectiveZ_On            1    /* Use InvW for hidden surface removal */
  473.  
  474. /* kQATag_TextureFilter */
  475. #define kQATextureFilter_Fast        0
  476. #define kQATextureFilter_Mid        1
  477. #define kQATextureFilter_Best        2
  478.  
  479. /* kQATag_TextureOp (mask of one or more) */
  480. #define kQATextureOp_None        0                /* Default texture mapping mode */
  481. #define kQATextureOp_Modulate    (1 << 0)        /* Modulate texture color with kd_r/g/b */
  482. #define kQATextureOp_Highlight    (1 << 1)        /* Add highlight value ks_r/g/b */
  483. #define kQATextureOp_Decal        (1 << 2)        /* When texture alpha == 0, use rgb instead */
  484. #define kQATextureOp_Shrink        (1 << 3)        /* This is a non-wrapping texture, so the ??? */
  485.  
  486. /* kQATag_CSGTag */
  487. #define kQACSGTag_None            0xffffffffUL    /* Do not perform CSG */
  488. #define kQACSGTag_0                0                /* Submitted tris have CSG ID 0 */
  489. #define kQACSGTag_1                1                /* Submitted tris have CSG ID 1 */
  490. #define kQACSGTag_2                2                /* Submitted tris have CSG ID 2 */
  491. #define kQACSGTag_3                3                /* Submitted tris have CSG ID 3 */
  492. #define kQACSGTag_4                4                /* Submitted tris have CSG ID 4 */
  493.  
  494. /* kQATagGL_TextureWrapU/V */
  495. #define kQAGL_Repeat                0
  496. #define kQAGL_Clamp                    1
  497.  
  498. /* kQATagGL_BlendSrc */
  499. #define kQAGL_SourceBlend_XXX        0
  500.  
  501. /* kQATagGL_BlendDst */
  502. #define kQAGL_DestBlend_XXX            0
  503.  
  504. /* kQATagGL_DrawBuffer (mask of one or more) */
  505. #define kQAGL_DrawBuffer_None        0
  506. #define kQAGL_DrawBuffer_FrontLeft    (1<<0)
  507. #define kQAGL_DrawBuffer_FrontRight    (1<<1)
  508. #define kQAGL_DrawBuffer_BackLeft    (1<<2)
  509. #define kQAGL_DrawBuffer_BackRight    (1<<3)
  510. #define kQAGL_DrawBuffer_Front        (kQAGL_DrawBuffer_FrontLeft | kQAGL_DrawBuffer_FrontRight)
  511. #define kQAGL_DrawBuffer_Back        (kQAGL_DrawBuffer_BackLeft | kQAGL_DrawBuffer_BackRight)
  512.  
  513. /************************************************************************************************
  514.  *
  515.  * Constants used as function parameters.
  516.  *
  517.  ***********************************************************************************************/
  518.  
  519. /*
  520.  * TQAVertexMode is a parameter to QADrawVGouraud() and QADrawVTexture() that specifies how
  521.  * to interpret and draw the vertex array.
  522.  */
  523.  
  524. typedef enum TQAVertexMode
  525. {
  526.     kQAVertexMode_Point                = 0,        /* Draw nVertices points */
  527.     kQAVertexMode_Line                = 1,        /* Draw nVertices/2 line segments */
  528.     kQAVertexMode_Polyline            = 2,        /* Draw nVertices-1 connected line segments */
  529.     kQAVertexMode_Tri                = 3,        /* Draw nVertices/3 triangles */
  530.     kQAVertexMode_Strip                = 4,        /* Draw nVertices-2 triangles as a strip */
  531.     kQAVertexMode_Fan                = 5            /* Draw nVertices-2 triangles as a fan from v0 */
  532. } TQAVertexMode;
  533.  
  534. /*
  535.  * TQAGestaltSelector is a parameter to QAEngineGestalt(). It selects which gestalt
  536.  * parameter will be copied into 'response'.
  537.  */
  538.  
  539. typedef enum TQAGestaltSelector
  540. {
  541.     kQAGestalt_OptionalFeatures        = 0,        /* Mask of one or more kQAOptional_xxx */
  542.     kQAGestalt_FastFeatures            = 1,        /* Mask of one or more kQAFast_xxx */
  543.     kQAGestalt_VendorID                = 2,        /* Vendor ID */
  544.     kQAGestalt_EngineID                = 3,        /* Engine ID */
  545.     kQAGestalt_Revision                = 4,        /* Revision number of this engine */
  546.     kQAGestalt_ASCIINameLength        = 5,        /* strlen (asciiName) */
  547.     kQAGestalt_ASCIIName            = 6            /* Causes strcpy (response, asciiName) */
  548. } TQAGestaltSelector;
  549.  
  550. #ifdef RAVE_1_1
  551.  
  552. /*
  553.  * TQAMethodSelector is a parameter to QASetNoticeMethod to select the notice method
  554.  */
  555.  
  556. typedef enum TQAMethodSelector
  557. {
  558.     kQAMethod_RenderCompletion        = 0
  559.     
  560. } TQAMethodSelector;
  561.  
  562. #endif
  563.  
  564. /*
  565.  * kQATriFlags_xxx are ORed together to generate the 'flags' parameter
  566.  * to QADrawTriGouraud() and QADrawTriTexture().
  567.  */
  568.  
  569. #define    kQATriFlags_None            0            /* No flags (triangle is front-facing or don't care) */
  570. #define kQATriFlags_Backfacing        (1 << 0)    /* Triangle is back-facing */
  571.  
  572. /*
  573.  * kQATexture_xxx are ORed together to generate the 'flags' parameter to QATextureNew().
  574.  */
  575.  
  576. #define    kQATexture_None                0            /* No flags */
  577. #define kQATexture_Lock                (1<<0)        /* Don't swap this texture out */
  578. #define kQATexture_Mipmap            (1<<1)        /* This texture is mipmapped */
  579. #define kQATexture_NoCompression    (1<<2)        /* Do not compress this texture */
  580. #define kQATexture_HighCompression    (1<<3)        /* Compress texture, even if it takes a while */
  581.  
  582. /*
  583.  * kQABitmap_xxx are ORed together to generate the 'flags' parameter to QABitmapNew().
  584.  */
  585.  
  586. #define    kQABitmap_None                0            /* No flags */
  587. #define kQABitmap_Lock                (1<<1)        /* Don't swap this bitmap out */
  588. #define kQABitmap_NoCompression        (1<<2)        /* Do not compress this bitmap */
  589. #define kQABitmap_HighCompression    (1<<3)        /* Compress bitmap, even if it takes a while */
  590.  
  591. /*
  592.  * kQAContext_xxx are ORed together to generate the 'flags' parameter for QADrawContextNew().
  593.  */
  594.  
  595. #define kQAContext_None                0            /* No flags */
  596. #define kQAContext_NoZBuffer        (1 << 0)    /* No hidden surface removal */
  597. #define kQAContext_DeepZ            (1 << 1)    /* Hidden surface precision >= 24 bits */
  598. #define kQAContext_DoubleBuffer        (1 << 2)    /* Double buffered window */
  599. #define kQAContext_Cache            (1 << 3)    /* This is a cache context */
  600.  
  601. /*
  602.  * kQAOptional_xxx are ORed together to generate the kQAGestalt_OptionalFeatures response
  603.  * from QAEngineGestalt().
  604.  */
  605.  
  606. #define kQAOptional_None            0            /* No optional features */
  607. #define kQAOptional_DeepZ            (1 << 0)    /* Hidden surface precision >= 24 bits */
  608. #define kQAOptional_Texture            (1 << 1)    /* Texture mapping */
  609. #define kQAOptional_TextureHQ        (1 << 2)    /* High quality texture (tri-linear mip or better) */
  610. #define kQAOptional_TextureColor    (1 << 3)    /* Full color modulation and highlight of textures */
  611. #define kQAOptional_Blend            (1 << 4)    /* Transparency blending of RGB */
  612. #define kQAOptional_BlendAlpha        (1 << 5)    /* Transparency blending includes alpha channel */
  613. #define kQAOptional_Antialias        (1 << 6)    /* Antialiased rendering */
  614. #define kQAOptional_ZSorted            (1 << 7)    /* Z sorted rendering (for transparency, etc.) */
  615. #define kQAOptional_PerspectiveZ    (1 << 8)    /* Hidden surface removal using InvW instead of Z */
  616. #define kQAOptional_OpenGL            (1 << 9)    /* Extended rasterization features for OpenGL™ */
  617. #define kQAOptional_NoClear            (1 << 10)    /* This drawing engine doesn't clear before drawing */
  618. #define kQAOptional_CSG                (1 << 11)    /* kQATag_CSGxxx are implemented */
  619. #define kQAOptional_BoundToDevice    (1 << 12)    /* This engine is tightly bound to GDevice */
  620. #define kQAOptional_CL4                (1 << 13)    /* This engine suports kQAPixel_CL4 */
  621. #define kQAOptional_CL8                (1 << 14)    /* This engine suports kQAPixel_CL8 */
  622.  
  623. /*
  624.  * kQAFast_xxx are ORed together to generate the kQAGestalt_FastFeatures response
  625.  * from QAEngineGestalt().
  626.  */
  627.  
  628. #define kQAFast_None                0            /* No accelerated features */
  629. #define kQAFast_Line                (1 << 0)    /* Line drawing */
  630. #define kQAFast_Gouraud                (1 << 1)    /* Gouraud shaded triangles */
  631. #define kQAFast_Texture                (1 << 2)    /* Texture mapped triangles */
  632. #define kQAFast_TextureHQ            (1 << 3)    /* High quality texture (tri-linear mip or better) */
  633. #define kQAFast_Blend                (1 << 4)    /* Transparency blending */
  634. #define kQAFast_Antialiasing        (1 << 5)    /* Antialiased rendering */
  635. #define kQAFast_ZSorted                (1 << 6)    /* Z sorted rendering of non-opaque objects */
  636. #define kQAFast_CL4                    (1 << 7)    /* This engine accelerates kQAPixel_CL4 */
  637. #define kQAFast_CL8                    (1 << 8)    /* This engine accelerates kQAPixel_CL8 */
  638.  
  639. /************************************************************************************************
  640.  *
  641.  * Macro definitions for the drawing engine methods included in TQADrawContext. These
  642.  * macros are the recommended means of accessing the engine's draw methods, e.g:
  643.  *
  644.  *        TQADrawContext    *drawContext;
  645.  *        TQAVTexture        vertices[3];
  646.  *
  647.  *        drawContext = QADrawContextNew (rect, gdevice, engine, kQAContext_ZBuffer);
  648.  *        ...
  649.  *        QASetInt (drawContext, kQATag_ZFunction, kQAZFunction_LT);
  650.  *        QADrawTriGouraud (drawContext, &vertices[0], &vertices[1], &vertices[2], kQATriFlags_None);
  651.  *
  652.  * Note that QARenderStart(), QARenderEnd(), QAFlush() and QASync() have real function
  653.  * definitions instead of macros. This is because these functions can afford the extra
  654.  * per-call overhead of a function layer (which makes application code a little smaller),
  655.  * and to allow a cleaner implementation of handling NULL parameters to QARenderStart().
  656.  *
  657.  ***********************************************************************************************/
  658.  
  659. #define QASetFloat(drawContext,tag,newValue) \
  660.         (drawContext)->setFloat (drawContext,tag,newValue)
  661.  
  662. #define QASetInt(drawContext,tag,newValue) \
  663.         (drawContext)->setInt (drawContext,tag,newValue)
  664.  
  665. #define QASetPtr(drawContext,tag,newValue) \
  666.         (drawContext)->setPtr (drawContext,tag,newValue)
  667.  
  668. #define QAGetFloat(drawContext,tag) \
  669.         (drawContext)->getFloat (drawContext,tag)
  670.  
  671. #define QAGetInt(drawContext,tag) \
  672.         (drawContext)->getInt (drawContext,tag)
  673.  
  674. #define QAGetPtr(drawContext,tag) \
  675.         (drawContext)->getPtr (drawContext,tag)
  676.  
  677. #define QADrawPoint(drawContext,v) \
  678.         (drawContext)->drawPoint (drawContext,v)
  679.  
  680. #define QADrawLine(drawContext,v0,v1) \
  681.         (drawContext)->drawLine (drawContext,v0,v1)
  682.  
  683. #define QADrawTriGouraud(drawContext,v0,v1,v2,flags) \
  684.         (drawContext)->drawTriGouraud (drawContext,v0,v1,v2,flags)
  685.  
  686. #define QADrawTriTexture(drawContext,v0,v1,v2,flags) \
  687.         (drawContext)->drawTriTexture (drawContext,v0,v1,v2,flags)
  688.  
  689. #define QASubmitVerticesGouraud(drawContext,nVertices,vertices) \
  690.         (drawContext)->submitVerticesGouraud(drawContext,nVertices,vertices)
  691.         
  692. #define QASubmitVerticesTexture(drawContext,nVertices,vertices) \
  693.         (drawContext)->submitVerticesTexture(drawContext,nVertices,vertices)
  694.         
  695. #define QADrawTriMeshGouraud(drawContext,nTriangle,triangles) \
  696.         (drawContext)->drawTriMeshGouraud (drawContext,nTriangle,triangles)
  697.  
  698. #define QADrawTriMeshTexture(drawContext,nTriangle,triangles) \
  699.         (drawContext)->drawTriMeshTexture (drawContext,nTriangle,triangles)
  700.  
  701. #define QADrawVGouraud(drawContext,nVertices,vertexMode,vertices,flags) \
  702.         (drawContext)->drawVGouraud (drawContext,nVertices,vertexMode,vertices,flags)
  703.  
  704. #define QADrawVTexture(drawContext,nVertices,vertexMode,vertices,flags) \
  705.         (drawContext)->drawVTexture (drawContext,nVertices,vertexMode,vertices,flags)
  706.  
  707. #define QADrawBitmap(drawContext,v,bitmap) \
  708.         (drawContext)->drawBitmap (drawContext,v,bitmap)
  709.  
  710. #define QARenderStart(drawContext,dirtyRect,initialContext) \
  711.         (drawContext)->renderStart (drawContext,dirtyRect,initialContext)
  712.  
  713. #define QARenderEnd(drawContext,modifiedRect) \
  714.         (drawContext)->renderEnd (drawContext,modifiedRect)
  715.  
  716. #define QARenderAbort(drawContext) \
  717.         (drawContext)->renderAbort (drawContext)
  718.  
  719. #define QAFlush(drawContext) \
  720.         (drawContext)->flush (drawContext)
  721.  
  722. #define QASync(drawContext) \
  723.         (drawContext)->sync (drawContext)
  724.  
  725. #ifdef RAVE_1_1
  726.  
  727. #define QASetNoticeMethod(drawContext, method, completionCallBack, refCon) \
  728.         (drawContext)->setNoticeMethod (drawContext, method, completionCallBack, refCon)
  729.  
  730. #define QAGetNoticeMethod(drawContext, method, completionCallBack, refCon) \
  731.         (drawContext)->getNoticeMethod (drawContext, method, completionCallBack, refCon)
  732.  
  733. #endif
  734.  
  735. /************************************************************************************************
  736.  *
  737.  * Typedefs of draw method functions provided by the drawing engine. One function pointer
  738.  * for each of these function types in stored in the TQADrawContext public data structure.
  739.  *
  740.  * These functions should be accessed through the QA<function>(context,...) macros,
  741.  * defined above.
  742.  *
  743.  ***********************************************************************************************/
  744.  
  745. #ifdef RAVE_1_1
  746.  
  747. typedef void (*TQANoticeMethod)(
  748.     TQADrawContext            *drawContext,        /* Draw context */
  749.     void                    *refCon);
  750.  
  751. #endif
  752.  
  753. typedef void (*TQASetFloat) (
  754.     TQADrawContext            *drawContext,        /* Draw context */
  755.     TQATagFloat                tag,                /* Tag of variable to set */
  756.     float                    newValue);            /* New value for variable */
  757.  
  758. typedef void (*TQASetInt) (
  759.     TQADrawContext            *drawContext,        /* Draw context */
  760.     TQATagInt                tag,                /* Tag of variable to set */
  761.     unsigned long            newValue);            /* New value for variable */
  762.  
  763. typedef void (*TQASetPtr) (
  764.     TQADrawContext            *drawContext,        /* Draw context */
  765.     TQATagPtr                tag,                /* Tag of variable to set */
  766.     const void                *newValue);            /* New value for variable */
  767.  
  768. typedef float (*TQAGetFloat) (
  769.     const TQADrawContext    *drawContext,        /* Draw context */
  770.     TQATagFloat                tag);                /* Tag of variable to get */
  771.  
  772. typedef unsigned long (*TQAGetInt) (
  773.     const TQADrawContext    *drawContext,        /* Draw context */
  774.     TQATagInt                tag);                /* Tag of variable to get */
  775.  
  776. typedef void *(*TQAGetPtr) (
  777.     const TQADrawContext    *drawContext,        /* Draw context */
  778.     TQATagPtr                tag);                /* Tag of variable to get */
  779.  
  780. typedef void (*TQADrawPoint) (
  781.     const TQADrawContext    *drawContext,        /* Draw context */
  782.     const TQAVGouraud        *v);                /* Vertex */
  783.  
  784. typedef void (*TQADrawLine) (
  785.     const TQADrawContext    *drawContext,        /* Draw context */
  786.     const TQAVGouraud         *v0,                /* Vertex 0 */
  787.     const TQAVGouraud         *v1);                /* Vertex 1 */
  788.  
  789. typedef void (*TQADrawTriGouraud) (
  790.     const TQADrawContext    *drawContext,        /* Draw context */
  791.     const TQAVGouraud         *v0,                /* Vertex 0 */
  792.     const TQAVGouraud         *v1,                /* Vertex 1 */
  793.     const TQAVGouraud         *v2,                /* Vertex 2 */
  794.     unsigned long            flags);                /* Mask of kQATriFlags_xxx flags */
  795.  
  796. typedef void (*TQADrawTriTexture) (
  797.     const TQADrawContext    *drawContext,        /* Draw context */
  798.     const TQAVTexture         *v0,                /* Vertex 0 */
  799.     const TQAVTexture         *v1,                /* Vertex 1 */
  800.     const TQAVTexture         *v2,                /* Vertex 2 */
  801.     unsigned long            flags);                /* Mask of kQATriFlags_xxx flags */
  802.  
  803. typedef void (*TQASubmitVerticesGouraud) (
  804.     const TQADrawContext        *drawContext,    /* Draw context */
  805.     unsigned long                 nVertices,        /* Number of vertices */
  806.     const TQAVGouraud             *vertices);        /* Array of vertices */
  807.     
  808. typedef void (*TQASubmitVerticesTexture) (
  809.     const TQADrawContext        *drawContext,    /* Draw context */
  810.     unsigned long                 nVertices,        /* Number of vertices */
  811.     const TQAVTexture            *vertices);        /* Array of vertices */
  812.     
  813. typedef void (*TQADrawTriMeshGouraud) (
  814.     const TQADrawContext        *drawContext,    /* Draw context */
  815.     unsigned long                 nTriangles,        /* Number of triangles */
  816.     const TQAIndexedTriangle    *triangles);    /* Array of triangles */
  817.     
  818. typedef void (*TQADrawTriMeshTexture) (
  819.     const TQADrawContext        *drawContext,    /* Draw context */
  820.     unsigned long                 nTriangles,        /* Number of triangles */
  821.     const TQAIndexedTriangle     *triangles);    /* Array of triangles */
  822.  
  823. typedef void (*TQADrawVGouraud) (
  824.     const TQADrawContext    *drawContext,        /* Draw context */
  825.     unsigned long            nVertices,            /* Number of vertices */
  826.     TQAVertexMode            vertexMode,            /* One of kQAVertexMode_xxx enumerated values */
  827.     const TQAVGouraud         vertices[],            /* Array of vertices */
  828.     const unsigned long        flags[]);            /* Array of per-triangle flags (or NULL) */
  829.  
  830. typedef void (*TQADrawVTexture) (
  831.     const TQADrawContext    *drawContext,        /* Draw context */
  832.     unsigned long            nVertices,            /* Number of vertices */
  833.     TQAVertexMode            vertexMode,            /* One of kQAVertexMode_xxx enumerated values */
  834.     const TQAVTexture         vertices[],            /* Array of vertices */
  835.     const unsigned long        flags[]);            /* Array of per-triangle flags (or NULL) */
  836.  
  837. typedef void (*TQADrawBitmap) (
  838.     const TQADrawContext    *drawContext,        /* Draw context */
  839.     const TQAVGouraud         *v,                    /* xyz, and (if a 1 bit/pixel bitmap) argb */
  840.     TQABitmap                *bitmap);            /* Previously allocated by QABitmapNew() */
  841.  
  842. typedef void (*TQARenderStart) (
  843.     const TQADrawContext    *drawContext,        /* Draw context */
  844.     const TQARect            *dirtyRect,            /* Minimum area to clear; NULL means whole buffer */
  845.     const TQADrawContext    *initialContext);    /* Initial background image (or NULL) */
  846.  
  847. typedef TQAError (*TQARenderEnd) (
  848.     const TQADrawContext    *drawContext,        /* Draw context */
  849.     const TQARect            *modifiedRect);        /* Minimum area to swap; NULL means whole buffer */
  850.  
  851. typedef TQAError (*TQARenderAbort) (
  852.     const TQADrawContext    *drawContext);        /* Draw context */
  853.  
  854. typedef TQAError (*TQAFlush) (
  855.     const TQADrawContext    *drawContext);        /* Draw context */
  856.  
  857. typedef TQAError (*TQASync) (
  858.     const TQADrawContext    *drawContext);        /* Draw context */
  859.  
  860. #ifdef RAVE_1_1
  861.  
  862. typedef TQAError (*TQASetNoticeMethod)(
  863.     const TQADrawContext    *drawContext,    /* Draw context */
  864.     TQAMethodSelector        method,
  865.     TQANoticeMethod            completionCallBack,
  866.     void                    *refCon);
  867.  
  868. typedef TQAError (*TQAGetNoticeMethod)(
  869.     const TQADrawContext    *drawContext,    /* Draw context */
  870.     TQAMethodSelector        method,
  871.     TQANoticeMethod            *completionCallBack,
  872.     void                    **refCon);
  873.  
  874. #endif
  875.  
  876. /************************************************************************************************
  877.  *
  878.  * Public TQADrawContext structure. This contains function pointers for the chosen
  879.  * drawing engine.
  880.  *
  881.  ***********************************************************************************************/
  882.  
  883. /*
  884.  * TQAVersion sets the TQADrawContext 'version' field. It is set by
  885.  * the manager to indicate the version of the TQADrawContext structure.
  886.  */
  887.  
  888. typedef enum TQAVersion
  889. {
  890.     kQAVersion_Prerelease        = 0,
  891.     kQAVersion_1_0                = 1,
  892.     kQAVersion_1_1                = 2        /* Added tri mesh functions, color tables */
  893. } TQAVersion;
  894.  
  895. struct TQADrawContext
  896. {
  897.     TQADrawPrivate            *drawPrivate;        /* Engine's private data for this context */
  898.     const TQAVersion        version;            /* Version number */
  899.     TQASetFloat                setFloat;            /* Method: Set a float state variable */
  900.     TQASetInt                setInt;                /* Method: Set an unsigned long state variable */
  901.     TQASetPtr                setPtr;                /* Method: Set an unsigned long state variable */
  902.     TQAGetFloat                getFloat;            /* Method: Get a float state variable */
  903.     TQAGetInt                getInt;                /* Method: Get an unsigned long state variable */
  904.     TQAGetPtr                getPtr;                /* Method: Get an pointer state variable */
  905.     TQADrawPoint            drawPoint;            /* Method: Draw a point */
  906.     TQADrawLine                drawLine;            /* Method: Draw a line */
  907.     TQADrawTriGouraud        drawTriGouraud;        /* Method: Draw a Gouraud shaded triangle */
  908.     TQADrawTriTexture        drawTriTexture;        /* Method: Draw a texture mapped triangle */
  909.     TQADrawVGouraud            drawVGouraud;        /* Method: Draw Gouraud vertices */
  910.     TQADrawVTexture            drawVTexture;        /* Method: Draw texture vertices */
  911.     TQADrawBitmap            drawBitmap;            /* Method: Draw a bitmap */
  912.     TQARenderStart            renderStart;        /* Method: Initialize for rendering */
  913.     TQARenderEnd            renderEnd;            /* Method: Complete rendering and display */
  914.     TQARenderAbort            renderAbort;        /* Method: Abort any outstanding rendering (blocking) */
  915.     TQAFlush                flush;                /* Method: Start render of any queued commands (non-blocking) */
  916.     TQASync                    sync;                /* Method: Wait for completion of all rendering (blocking) */
  917.     TQASubmitVerticesGouraud    submitVerticesGouraud;    /* Method: Submit Gouraud vertices for trimesh */
  918.     TQASubmitVerticesTexture    submitVerticesTexture;    /* Method: Submit Texture vertices for trimesh */
  919.     TQADrawTriMeshGouraud        drawTriMeshGouraud;        /* Method: Draw a Gouraud triangle mesh */
  920.     TQADrawTriMeshTexture        drawTriMeshTexture;        /* Method: Draw a Texture triangle mesh */
  921. };
  922.  
  923. /************************************************************************************************
  924.  *
  925.  * Acceleration manager function prototypes.
  926.  *
  927.  ***********************************************************************************************/
  928.  
  929. RAVE_EXPORT TQAError QADrawContextNew (
  930.     const TQADevice    *device,                /* Target device */
  931.     const TQARect    *rect,                    /* Target rectangle (device coordinates) */
  932.     const TQAClip    *clip,                    /* 2D clip region */
  933.     const TQAEngine    *engine,                /* Drawing engine to use */
  934.     unsigned long    flags,                    /* Mask of kQAContext_xxx */
  935.     TQADrawContext    **newDrawContext);        /* (Out) Newly created TQADrawContext */
  936.  
  937. RAVE_EXPORT void QADrawContextDelete (
  938.     TQADrawContext    *drawContext);            /* Context to delete */
  939.  
  940. RAVE_EXPORT TQAError QAColorTableNew(
  941.     const TQAEngine        *engine,            /* Drawing engine to use */
  942.     TQAColorTableType    tableType,            /* Depth, color space, etc. */
  943.     void                *pixelData,            /* lookup table entries in pixelType format */
  944.     long                transparentIndexFlag,    /* boolean, false means no transparency, true means index 0 is transparent */
  945.     TQAColorTable        **newTable);        /* (Out) Newly created TQAColorTable */
  946.  
  947. RAVE_EXPORT void QAColorTableDelete(
  948.     const TQAEngine        *engine,            /* Drawing engine to use */
  949.     TQAColorTable        *colorTable);        /* Previously allocated by QAColorTableNew() */
  950.  
  951. RAVE_EXPORT TQAError QATextureNew (
  952.     const TQAEngine        *engine,            /* Drawing engine to use */
  953.     unsigned long        flags,                /* Mask of kQATexture_xxx flags */
  954.     TQAImagePixelType    pixelType,            /* Depth, color space, etc. */
  955.     const TQAImage        images[],            /* Image(s) for texture */
  956.     TQATexture            **newTexture);        /* (Out) Newly created TQATexture, or NULL on error */ 
  957.  
  958. RAVE_EXPORT TQAError QATextureDetach (
  959.     const TQAEngine        *engine,            /* Drawing engine to use */
  960.     TQATexture            *texture);            /* Previously allocated by QATextureNew() */
  961.  
  962. RAVE_EXPORT void QATextureDelete (
  963.     const TQAEngine        *engine,            /* Drawing engine to use */
  964.     TQATexture            *texture);            /* Previously allocated by QATextureNew() */
  965.  
  966. RAVE_EXPORT TQAError QATextureBindColorTable(
  967.     const TQAEngine        *engine,            /* Drawing engine to use */
  968.     TQATexture            *texture,            /* Previously allocated by QATextureNew() */
  969.     TQAColorTable        *colorTable);        /* Previously allocated by QAColorTableNew() */
  970.     
  971. RAVE_EXPORT TQAError QABitmapNew (
  972.     const TQAEngine        *engine,            /* Drawing engine to use */
  973.     unsigned long        flags,                /* Mask of kQABitmap_xxx flags */
  974.     TQAImagePixelType    pixelType,            /* Depth, color space, etc. */
  975.     const TQAImage        *image,                /* Image */
  976.     TQABitmap            **newBitmap);        /* (Out) Newly created TQABitmap, or NULL on error */ 
  977.  
  978. RAVE_EXPORT TQAError QABitmapDetach (
  979.     const TQAEngine        *engine,            /* Drawing engine to use */
  980.     TQABitmap            *bitmap);            /* Previously allocated by QABitmapNew() */
  981.  
  982. RAVE_EXPORT void QABitmapDelete (
  983.     const TQAEngine        *engine,            /* Drawing engine to use */
  984.     TQABitmap            *bitmap);            /* Previously allocated by QABitmapNew() */
  985.  
  986. RAVE_EXPORT TQAError QABitmapBindColorTable(
  987.     const TQAEngine        *engine,            /* Drawing engine to use */
  988.     TQABitmap            *bitmap,            /* Previously allocated by QABitmapNew() */
  989.     TQAColorTable        *colorTable);        /* Previously allocated by QAColorTableNew() */
  990.     
  991. RAVE_EXPORT TQAEngine *QADeviceGetFirstEngine (
  992.     const TQADevice    *device);                /* Target device */
  993.  
  994. RAVE_EXPORT TQAEngine *QADeviceGetNextEngine (
  995.     const TQADevice    *device,                /* Target device */
  996.     const TQAEngine    *currentEngine);        /* Engine after 'currentEngine' is returned */
  997.  
  998. RAVE_EXPORT TQAError QAEngineCheckDevice (
  999.     const TQAEngine    *engine,                /* Engine to check on 'device' */
  1000.     const TQADevice    *device);                /* Target device */
  1001.  
  1002. RAVE_EXPORT TQAError QAEngineGestalt (
  1003.     const TQAEngine        *engine,            /* Engine being queried */
  1004.     TQAGestaltSelector    selector,            /* Gestalt parameter being requested */
  1005.     void                *response);            /* Buffer that receives response */
  1006.  
  1007. RAVE_EXPORT TQAError QAEngineEnable (
  1008.     long            vendorID,                /* Vendor ID of engine to enable */
  1009.     long            engineID);                /* Engine ID of engine to enable */
  1010.  
  1011. RAVE_EXPORT TQAError QAEngineDisable (
  1012.     long            vendorID,                /* Vendor ID of engine to disable */
  1013.     long            engineID);                /* Engine ID of engine to disable */
  1014.  
  1015. #ifdef __cplusplus
  1016. }
  1017. #endif
  1018.  
  1019. #endif /* _RAVE_h */
  1020.